//
//  JCGCDUtil.m
//  JCPublicKit-Objc
//
//  Created by JasonLee on 2020/4/24.
//

#import "JCGCDUtil.h"

@implementation JCGCDUtil

+ (void)onMainAsync:(void (^ _Nonnull)(void))block {
    [JCGCDUtil asyncOnQueue:dispatch_get_main_queue() block:block];
}
+ (void)asyncOnQueue:(dispatch_queue_t _Nonnull)queue block:(void (^ _Nonnull)(void))block {
    dispatch_async(queue, block);
}

+ (void)onMainAfterDelay:(int64_t)delay block:(void (^ _Nonnull)(void))block {
    [JCGCDUtil afterDelay:delay onQueue:dispatch_get_main_queue() block:block];
}
+ (void)afterDelay:(int64_t)delay onQueue:(dispatch_queue_t _Nonnull)queue block:(void (^ _Nonnull)(void))block {
    dispatch_after(dispatch_time(DISPATCH_TIME_NOW, delay), queue, block);
}

@end
